[SSF 163] - Fix Donation Creation Bug and Improve API Design#128
[SSF 163] - Fix Donation Creation Bug and Improve API Design#128dburkhart07 merged 19 commits intomainfrom
Conversation
apps/backend/src/donationItems/dtos/create-donation-items.dto.ts
Outdated
Show resolved
Hide resolved
Juwang110
left a comment
There was a problem hiding this comment.
Besides two small nits looks great to me!
sam-schu
left a comment
There was a problem hiding this comment.
Can we use the transaction naming convention we previously discussed?
sam-schu
left a comment
There was a problem hiding this comment.
Bumping the transaction naming convention - we should have transactionManager, transactionRepo, etc.
| items: validItems, | ||
| }); | ||
|
|
||
| expect(donation).toBeDefined(); |
There was a problem hiding this comment.
Can we check the donation is actually in the db? and check the rest of the fields?
There was a problem hiding this comment.
Unresolving (looks like you did the donation items, not the donation)
sam-schu
left a comment
There was a problem hiding this comment.
Please address the remaining testing comments including unresolved comments from last time, other than that looks good!
| items: validItems, | ||
| }); | ||
|
|
||
| expect(donation).toBeDefined(); |
There was a problem hiding this comment.
Unresolving (looks like you did the donation items, not the donation)
ℹ️ Issue
Closes #163
📝 Description
For this PR, I removed the usage of creating multiple donation items, in favor of keeping it all in one spot: the donation service's create endpoint. This now creates all of it in one spot, allowing us to easily verify the creation of donations and donation items all in one transaction. This required minimal frontend changes to properly format and make work. I also removed any usage of reservedQuantity, having that value only be used on creation time of donation items.
I also wrote tests for the create service function, as well as all new tests for the donation item's service.
✔️ Verification